package com.woniu.service.impl;

import com.woniu.dao.ActivityComplainMapper;
import com.woniu.dto.ActivityComplainDTO;
import com.woniu.service.ActivityComplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ActivityComplainServiceImpl implements ActivityComplainService {

    @Autowired
    private ActivityComplainMapper acComplainMapper;
    @Override
    public List<ActivityComplainDTO> findByPage(Integer currentPage, Integer pageSize) {
        List<ActivityComplainDTO> list = acComplainMapper.findByPage(currentPage,pageSize);
        return list;
    }

    @Override
    public ActivityComplainDTO findById(Integer id) {
        return acComplainMapper.findById(id);
    }

    @Override
    public void addReply(ActivityComplainDTO activityComplainDTO) {
        String context=activityComplainDTO.getContext();
        Integer id=activityComplainDTO.getId();
        Date replyTime=new Date();
        acComplainMapper.addReply(id,context,replyTime);
    }

    @Override
    public List<ActivityComplainDTO> select(String nickName, String title) {
        List<ActivityComplainDTO> list=acComplainMapper.select(nickName,title);
        return list;
    }
}
